<template>
    <van-tabbar v-model="active" active-color="#39be77">
      <van-tabbar-item name="/home" icon="bar-chart-o" to="/home">统计</van-tabbar-item>
      <van-tabbar-item name="/manage/article" icon="notes-o" to="/manage">管理</van-tabbar-item>
      <van-tabbar-item name="/user" icon="user-o" to="/user">设置</van-tabbar-item>
    </van-tabbar>

</template>

<script>
import { ref } from 'vue';    
import { useRouter } from 'vue-router';
export default {
    setup() {
    const router = useRouter()
    const active = ref('/home');
   
    router.afterEach((to,from)=>{
        active.value = to.path
    })

    return { active };
  },

}
</script>

<style scoped>

</style>